package com.food.eat.search.config;

import org.springframework.context.annotation.Configuration;

import javax.annotation.PostConstruct;

/**
 * @Author:RenPu
 * @Date: 2020/8/10 11:59
 * @Version: 1.0
 * @description: 解决boot集成elasticsearch的启动报java.lang.IllegalStateException: availableProcessors is already set to [4]的问题
 */


@Configuration
public class ESConfig {

    /**
     * 解决netty引起的issue的问题
     */

    @PostConstruct
    void init() {

        System.setProperty("es.set.netty.runtime.available.processors", "false");

    }


}
